package com.hardydou.pattern.factory;

public class ShapeFactory {

    public static enum ShapeType {
        CIRCLE_T, RECTANGLE_T, SQUARE_T;

    }

    public static Shape getShape(ShapeType shapeType) {
        if (shapeType == null) {
            return null;
        }
        if (shapeType == ShapeType.CIRCLE_T) {
            return new Circle();
        } else if (shapeType == ShapeType.RECTANGLE_T) {
            return new Rectangle();
        } else if (shapeType == ShapeType.SQUARE_T) {
            return new Square();
        }
        return null;
    }
}
